﻿using System.Collections.Generic;
using NUnit.Framework;

namespace InvoiceInvoker.Logic.Tests
{
	[TestFixture]
	public class VatRatesProviderTests
	{
		[Test]
		public void GetsVatRates()
		{
			List<string> result = VatRatesProvider.GetVatRates();

			Assert.AreEqual(6, result.Count);
			Assert.AreEqual("22%", result[0]);
			Assert.AreEqual("7 %", result[1]);
			Assert.AreEqual("3 %", result[2]);
			Assert.AreEqual("0 %", result[3]);
			Assert.AreEqual("n.p.", result[4]);
			Assert.AreEqual("z.w.", result[5]);
		}

		[Test, Sequential]
		public void GetsVatPercentage([Values("10 %", "10%", "0 %", "0%", "n/a")]string vatRate, [Values(10, 10, 0, 0, 0)] int expectedPercentage)
		{
			int result = VatRatesProvider.GetVatPercentage(vatRate);
			Assert.AreEqual(expectedPercentage, result);
		}
	}
}
